#pragma once
#include <iostream>
#include <string>
#include <cstring>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <functional>
#include <unistd.h>

enum ExitCode//退出码
{
    OK=0,
    USAGE_ERR,
    SOCKET_ERR,
    BIND_ERR,
    CONNECT_ERR,
    FORK_ERR
};

class NoCopy//服务器往往是禁止拷贝的
{
public:
    NoCopy(){}
    ~NoCopy(){}
    NoCopy(const NoCopy&) = delete;
    const NoCopy& operator=(const NoCopy&) = delete;
};

//定义强转宏
#define CONV(addr) (struct sockaddr*)&(addr)